<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%@ taglib uri="http://java.sun.com/jstl/core_rt" prefix="c"%>
<%
	String path = request.getContextPath();
	String basePath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort()
			+ path + "/";
%>
<c:set var="path" value="${pageContext.request.contextPath }" />
<!DOCTYPE html>
<html lang="en">

<head>
<meta charset="utf-8">
<meta name="viewport"
	content="width=device-width, initial-scale=1.0, maximum-scale=1.0">

<title>Matrix登录</title>
<script type="text/javascript"
	src="${path }/resource/js/jquery-2.1.4.min.js"></script>
<script type="text/javascript"
	src="${path }/resource/js/systools/MBase.js"></script>
<link href="${path }/resource/css/login.min.css" rel="stylesheet">
<!--[if lt IE 8]>
    <meta http-equiv="refresh" content="0;ie.html" />
   	<![endif]-->
<script type="text/javascript">
$(function(){(
		function ($) {
   			$.getUrlParam = function (name) {
    		var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)");
    		var r = window.location.search.substr(1).match(reg);
    		if (r != null){
    			return unescape(r[2]);
    		}else{
    			return null;
    		}  
   		}
  	})(jQuery);
  	
	var ddUserId = $.getUrlParam("ddUserId");
	console.log(ddUserId);
	$.AjaxProxy({
		p : {
			ddUserId : ddUserId
		}
	}).invoke("${path}/dd/dingding/autoLogin", function(loj) {
		var status = loj.getValue("status");
		if(status == "ok"){
			MTools.redirect("${path}/" + loj.getValue("page"));
		}
		if(status == "err"){
			MTools.redirect("${path}/common/redirect/login");
		}	
	});

  	
});

</script>


</head>

</html>